#pragma once
#include "../SGD Wrappers/SGD_Geometry.h"
#include "../SGD Wrappers/SGD_Color.h"
#include "Flyweight.h"

class Particle 
{
public:

	Particle();
	Particle(Flyweight* fw);
	~Particle();

	void Update(float dt);
	void Render();
	void Reset();

	SGD::Vector		InitializeVelocity();

	//Accessors
	SGD::Vector		GetCurVelocity()	const	{ return m_curVelocity; }
	SGD::Color		GetCurColor()		const	{ return m_curColor; }
	SGD::Point		GetPosition()		const	{ return m_ptPosition; }
	float			GetRotation()		const	{ return m_fRotation; }
	float			GetLifeSpan()		const	{ return m_fLifeSpan; }
	float			GetScale()			const	{ return m_fScale; }
	float			GetLifeLeft()		const	{ return m_fLifeLeft; }
	Flyweight*		GetOwner()					{ return m_pOwner; }

	//Mutators
	void		SetVelocity(SGD::Vector vel)	{ m_v2fVelocity = vel; }
	void		SetPosition(SGD::Point pos)		{ m_ptPosition = pos; }
	void		SetColor(SGD::Color color)		{ m_curColor = color; }
	void		SetRoation(float rotation)		{ m_fRotation = rotation; }
	void		SetLifeSpan(float lifespan)		{ m_fLifeSpan = m_fLifeLeft = lifespan; }
	void		SetScale(float scale)			{ m_fScale = m_fStartScale = scale; }
	void		SetOwner(Flyweight& fw)			{ m_pOwner = &fw; }

private:

	SGD::Vector		m_v2fVelocity;
	SGD::Point		m_ptPosition;
	SGD::Color		m_curColor;
	SGD::Vector		m_curVelocity;
	float			m_fRotation;
	float			m_fLifeSpan;
	float			m_fLifeLeft;
	float			m_fScale;
	float			m_fStartScale;
	float			m_fColorTimer;
	Flyweight*		m_pOwner;
};